<%@ page contentType="text/html; charset=UTF-8" import="java.util.*,javax.naming.directory.*;"%>
<%
DirContext ctx = null;
Hashtable env = new Hashtable();
env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(javax.naming.Context.PROVIDER_URL, "ldap://172.18.1.20/cn=pidoperator,DC=cn,DC=alphanetworks,DC=com");
env.put(javax.naming.Context.SECURITY_AUTHENTICATION,"Simple");
env.put(javax.naming.Context.SECURITY_PRINCIPAL,"cn=pid,ou=DGUsers,DC=cn,DC=alphanetworks,DC=com");
env.put(javax.naming.Context.SECURITY_CREDENTIALS , "" );

try{
  ctx = new InitialDirContext(env);
  out.println("login ok");
}
catch(Exception e){
  e.printStackTrace();
}
%>
